package com.itheima.chapter06.innerclass.test3;

public class Test3 {
    public static void main(String[] args) {
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("铁汁，我们游泳去！");
            }
        });
    }
    public static void goSwimming(Swimming swimming){
        Swimming swim=new Swimming() {
            @Override
            public void swim() {
                System.out.println("铁汁，我们游泳去！-------");
            }
        };
        swimming.swim();//匿名内部类
        swim.swim();
    }
}

interface Swimming{
    void swim();
}